package summary;

import java.util.*;

/**
 * @Author: 海琳琦
 * @Date: 2022/8/21 21:32
 */
public class Title50 {

    class State{
        int y;

        int a;

        int b;

        public State(int y, int a, int b) {
            this.y = y;
            this.a = a;
            this.b = b;
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        //<x,<y,<a,b>>>
        Map<Integer, HashMap<Integer, int[]>> hash = new HashMap<>();
        for (int i = 0; i < m; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            int a = sc.nextInt();
            int b = sc.nextInt();
            hash.computeIfAbsent(x, g -> new HashMap<>()).put(y, new int[]{a, b});
        }
        int min = Integer.MAX_VALUE;
        int cur = 0;


    }
}
